package cn.jltx.hellojni;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import cn.jltx.javajni.IHelloJni;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
    private TextView textView;
    private Button btn1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textView= (TextView)findViewById(R.id.tv);
        textView.setText(IHelloJni.stringFromJNI());

        btn1 = (Button)findViewById(R.id.btn1);
        btn1.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn1:
                textView.setText(IHelloJni.unimplementedStringFromJNI());
                break;
            default:
                break;
        }
    }
}
